package edu.neu.agv_backend.controller;

import edu.neu.agv_backend.dto.AjaxResult;
import edu.neu.agv_backend.service.MovementService;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/api/agv/movement")
public class MovementController {

    private final MovementService movementService;

    public MovementController(MovementService movementService) {
        this.movementService = movementService;
    }

    @GetMapping("/heartbeat")
    public AjaxResult<Void> heartbeat() {
        return movementService.heartbeat();
    }

    @PostMapping("/forward")
    public AjaxResult<Void> forward() {
        return movementService.forward();
    }

    @PostMapping("/stop")
    public AjaxResult<Void> stop() {
        return movementService.stop();
    }

    @PostMapping("/backward")
    public AjaxResult<Void> backward() {
        return movementService.backward();
    }
} 